<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>对象的解构</title>
</head>
<body>
    
</body>
<script>
    // es5
    obj = {
        name:"xym",
        age:18,
        gender:'男'
    }

    // es5 对象名.属性/方法
    //let name = obj.name;
    //let newAge = obj.age;
    //let gender = obj.gender;
    //console.log(name,newAge,gender);

    //es6
    let {name,age:newAge,gender} = obj;
    console.log(newAge,name,gender);
    
</script>
</html>